import axios from 'axios'
import qs from 'qs'
let http = axios.create({
  'Content-Type': 'application/x-www-form-urlencoded',
  post: {
    'Accept': 'text/html',
    'Content-Type': 'application/json'
  },
  transformRequest: [function(data) {
    return qs.stringify(data)
  }],
  // headers: {'X-Requested-With': 'XMLHttpRequest'},
  baseURL: process.env.API_ROOT,
  // withCredentials:true
})
export default {
  install: function(vm) {
    vm.prototype.$http = http
  }
}
